Skip to content

GeoWebCacheEnvironment.resolveValueIfEnabled doesn't parse booleans from resolved value#1436

Merged
aaime merged 1 commit into
GeoWebCache:mainfrom
groldan:bug/gwcenv_resolve_boolean
Oct 13, 2025
Merged

GeoWebCacheEnvironment.resolveValueIfEnabled doesn't parse booleans from resolved value#1436
aaime merged 1 commit into
GeoWebCache:mainfrom
groldan:bug/gwcenv_resolve_boolean

Conversation

@groldan

@groldan groldan commented Oct 13, 2025

Copy link
Copy Markdown
Member

Fix a bug where GeoWebCacheEnvironment.resolveValueIfEnabled(String, Class) won't use the resolved value from the env variable or system property when a boolean is requested.

--- a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheEnvironment.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheEnvironment.java
@@ -178,7 +178,7 @@ public <T> Optional<T> resolveValueIfEnabled(final String value, Class<T> type)
         } else if (type.isAssignableFrom(Boolean.class)) {
             if (!validateBoolean(resultValue))
                 throw new IllegalArgumentException("Illegal String parameter: Resolved value is not a boolean.");
-            Boolean boolValue = Boolean.valueOf(value);
+            Boolean boolValue = Boolean.valueOf(resultValue);
             return (Optional<T>) Optional.of(boolValue);
         }

…rom resolved value

Fix a bug where GeoWebCacheEnvironment.resolveValueIfEnabled(String,
Class) won't use the resolved value from the env variable or system
property when a boolean is requested.
@aaime

aaime commented Oct 13, 2025

Copy link
Copy Markdown
Member

Looks good to me

@aaime
aaime merged commit ebc715a into GeoWebCache:main Oct 13, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants